Using Sentinel Values to Indicate Unreliable Data
The OPC EIEs allow for configurability on point processing to handle unreliable values returned from an OPC server. A user can optionally change the point status bits and retain the point value. This implementation mirrors the way the OPCIS and OPC Groups use sentinel values to indicate when to retain and when to discard values.
In the OPC EIEs this is accomplished in two ways:
- Device Template File. An optional attribute "updateValue" is supported in the qualityMapping section of the device template file (DTF), which can be added to any mapped quality bit. When the attribute is set to "false", the status bit(s) on the CygNet point will be updated, but the point value will retain the last value. The default setting is "true". See OPC Quality Mapping for more information.
- Sentinel Values. To accommodate OPC servers that send sentinel values to indicate data quality, sentinels can be set on CygNet remote devices. Sentinels can be configured in the DTF (at the device level or on individual data groups), on the Device page of the Device Editor (where it would then apply to all data groups on that device), or on individual Data Groups (on the Data Group Properties dialog box).
The DTF attributes are "defaultSentinelValue" (an r8 value) and "defaultUseSentinel" (a Boolean value). The CygNet Explorer user interface (UI) (Device Properties page and Data Group Properties dialog box) reflects the DTF defaults, when configured for a new device or data group.
The value used for the sentinel is determined in the following order (if “Use sentinel” is set):
- If the Sentinel value is specified in the Data Group Properties dialog box, use that value
- Else, if the Sentinel value is specified in the Device Properties page, use that value
- Else, if the "defaultSentinelValue" is specified in the DTF for the data group, use that value
- Else, if the "defaultSentinelValue" is specified in the DTF for the device, use that value
- Else, the value will be 0.
The "UseSentinel" attribute is determined in a similar way and the UI for new devices and data groups reflects the DTF defaults.
The "UseSentinel" and "SentinelValue" parameters are stored in the device specific info and data group specific info.
These can be modified via script and viewed in the DDS Transaction Viewer utility (DdsViewer).
Device Template File
The following example from a OPC_Matrikon.dtf displays sample "updateValue", "defaultSentinelValue", and "defaultUseSentinel" usage.
<deviceDefinition deviceType="MatrikonSim" mfg="CygNet" desc="OPC Matrikon Simulator" category="4098" model="Generic" eieType="OPC" defaultSentinelValue="-9999" defaultUseSentinel="1" cygnetVersion="9.8.1000" customerVersion="">
<!--This template was developed using the Matrikon Simulator OPC server-->
<dataGroups udcCat="UDCALL" canRecv="true" canSend="false" uccRecv="true" uccSend="false" udcDefFac="true" devDG="false" baseOrd="0" maxCnt="1" forceSave="true">
...
<Sample niceName="Sample" defaultSentinelValue="888.888" defaultUseSentinel="1">
<dgElements secLev="4" type="vrnt">
<N001 desc="STW i1" itemId="Saw-toothed Waves.Int1"/>
<N002 desc="STW r8" itemId="Saw-toothed Waves.Real8"/>
<Quality desc="Quality" itemId="Random.Qualities"/>
<test desc="Test" itemId="Bucket Brigade.Int1"/>
</dgElements>
</Sample>
</dataGroups>
...
<qualityMapping >
<StatBad mask="0xC0" value="0" setUnreliable="true" updateValue="false"/>
<StatUncert mask="0xC0" value="0x40" setUnreliable="true" updateValue="false"/>
<StatUnknwn mask="0xC0" value="0x80" setUnreliable="true" updateValue="false"/>
<!-- Quality 0 (bad) sub-status /-->
<BadX mask="0xFC" value="0x00" updateValue="false"/>
<CfgErr mask="0xFC" value="0x04" setUser1="true" />
<NotConn mask="0xFC" value="0x08" setUser2="true" />
<DevFail mask="0xFC" value="0x0C" setUser3="true" />
<SensFail mask="0xFC" value="0x10" setUser4="true" />
<LastKnown mask="0xFC" value="0x14" setUser5="true" />
<CommFail mask="0xFC" value="0x18" setUser6="true" />
<OutOfSvc mask="0xFC" value="0x1C" setUser7="true" />
<!-- Quality 1 (Uncertain) sub-status /-->
<UncertainX mask="0xFC" value="0x40" />
<NotInit mask="0xFC" value="0x20" setUser8="true" />
<LastUsable mask="0xFC" value="0x44" setUser9="true" />
<SensorCal mask="0xFC" value="0x50" setUser10="true" />
<EguExceed mask="0xFC" value="0x54" setUser11="true" />
<SubNormal mask="0xFC" value="0x58" setUser12="true" />
<!-- Quality 3 (good) sub-status /-->
<GoodX mask="0xFC" value="0xC0" />
<Override mask="0xFC" value="0xD8" setUser13="true" />
<!-- Limit bits -->
<LimitOk mask="0x03" value="0x00" />
<LimitLow mask="0x03" value="0x01" setUser14="true" />
<LimitHigh mask="0x03" value="0x02" setUser15="true" />
<LimitConst mask="0x03" value="0x03" setUser16="true" />
</qualityMapping>
</deviceDefinition>


